# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=kimap
pkgver=22.04.3
pkgrel=0
pkgdesc="Job-based API for interacting with IMAP servers"
# armhf blocked by extra-cmake-modules
# s390x and riscv64 blocked by kio-dev
arch="all !armhf !s390x !riscv64"
url="https://community.kde.org/KDE_PIM"
license="LGPL-2.0-or-later"
depends_dev="
	cyrus-sasl-dev
	kcoreaddons-dev
	ki18n-dev
	kio-dev
	kmime-dev
	qt5-qtbase-dev
	samurai
	"
makedepends="$depends_dev
	extra-cmake-modules
	"
source="https://download.kde.org/stable/release-service/$pkgver/src/kimap-$pkgver.tar.xz"
subpackages="$pkgname-dev"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	cd build

	# loginjobtest is broken
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest -E "loginjobtest"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
4b35341c8dbcf592ecf9ee26062c31c1f56ab592a71313e768370e4e22ef825ccea0f39b5e7f71ca3752bc2cb227abe59e9d4434d0d5bda909df93444bed24d8  kimap-22.04.3.tar.xz
"
